home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / Direct Blitting in C++ / Blitting.sit / Blitting ƒ / CDirectBlit.cp < prev    next >
Text File  |  1995-04-27  |  2KB  |  80 lines

  1. // CDirectBlit.cp, the CDirectBlit class methods
  2. //
  3. // Copyright ⌐ 1995, Macneil Shonle. All rights reserved.
  4.  
  5. #ifndef __CDIRECTBLIT__
  6. #include <CDirectBlit.h>
  7. #endif
  8.  
  9. #ifndef __PIXELTYPES__
  10. #include <PixelTypes.h>
  11. #endif
  12.  
  13. PixelPtr CDirectBlit::GetBaseAddress()
  14. {    return mBaseAddress;
  15. }
  16.  
  17. RowWidth CDirectBlit::GetRowBytes()
  18. {    return mRowBytes;
  19. }
  20.  
  21. RowWidth CDirectBlit::GetWidth()
  22. {    return RowWidth(mBounds.right - mBounds.left);
  23. }
  24.  
  25. ColumnHeight CDirectBlit::GetHeight()
  26. {    return ColumnHeight(mBounds.bottom - mBounds.top);
  27. }
  28.  
  29. Rect* CDirectBlit::GetBounds()
  30. {    return &mBounds;
  31. }
  32.  
  33. Rect* CDirectBlit::GetPortRect()
  34. {    return &mPort->portRect;
  35. }
  36.  
  37. CGrafPtr CDirectBlit::GetMacPort()
  38. {    return mPort;
  39. }
  40.  
  41. GDHandle CDirectBlit::GetMacDevice()
  42. {    return mGDevice;
  43. }
  44.  
  45. BitMap* CDirectBlit::GetBitMap()
  46. {    return &(GrafPtr(mPort)->portBits);
  47. }
  48.  
  49. BitDepth CDirectBlit::GetBitDepth()
  50. {    return mBitDepth;
  51. }
  52.  
  53. int CDirectBlit::Use32Bit()
  54. {    return mAddressingMode;
  55. }
  56.  
  57. PixelPtr CDirectBlit::GetAddressOfRow( PixelCoordinate theRow )
  58. {    return mRowAddresses[theRow];
  59. }
  60.  
  61. PixelPtr CDirectBlit::GetAddressOfPixel( PixelCoordinate h, PixelCoordinate v )
  62. {    return PixelPtr(mRowAddresses[v] + h);
  63. }
  64.  
  65. void CDirectBlit::BuildQuickRow()
  66. {    ColumnHeight height = mBounds.bottom - mBounds.top;
  67.     
  68.     mRowAddresses = new PixelPtr[height];
  69.     
  70.     if( mRowAddresses == 0 )
  71.         ::DebugStr( "\pPrimitive Error Checking" );
  72.     
  73.     for( ColumnHeight i=0; i<height; i++ )
  74.         mRowAddresses[i] = mBaseAddress + (mRowBytes * i);
  75. }
  76.  
  77. void CDirectBlit::DestroyQuickRow()
  78. {    delete [] mRowAddresses;
  79. }
  80.